package com.brillilab.service.module.message.template.impl.lab;

import com.brillilab.service.module.message.template.AbstractMessageTemplate;
import com.brillilab.service.module.message.template.enums.MessageTypeEnum;
import lombok.Data;

/**
 * 实验过期通知模板
 * @author WuMenghao
 */
@Data
public class BeforeLabExpireTemplate extends AbstractMessageTemplate {
    private long expireDays;

    /**
     *
     * @param labId      实验室Id
     * @param receiverId PI的userId
     * @param labMemberId PI的labMemberId
     * @param expireDays 实验室过期时间
     * @param referId 实验室Id
     */
    public BeforeLabExpireTemplate(Long labId,Long receiverId,Long labMemberId,Long expireDays,Long referId) {
        super(labId,receiverId);
        this.expireDays = expireDays;
        super.setType(MessageTypeEnum.BeforeLabExpire.getValue());
        super.setTitle("实验室试用期即将到期");
        super.setLabMemberId(labMemberId);
        super.setReferId(referId);
        String content = String.format("<span>您好，您的实验室试用期到期</span>" +
                        "<span style='color:#F6AC2D'>仅剩%s天</span>" +
                        "<span>，到期后您将无法对本实验室进行操作，请尽快完成分享将实验室升级</span>",
                expireDays);
        super.setContent(content);
        super.setAppContent(
                String.format("您好，您的实验室试用期到期仅剩%s天</span>，到期后您将无法对本实验室进行操作，请尽快完成分享将实验室升级",
                expireDays));
    }
}
